<div id="delete-dialog-confirm" class="hide">
    <div class="alert alert-info bigger-110">
       该操作将不可恢复,确认删除吗?
    </div>

    <div class="space-6"></div>

    <p class="bigger-110 bolder center grey">
        <i class="icon-hand-right blue bigger-120"></i>
        确认删除数据?
    </p>
</div>

<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
	<i class="icon-double-angle-up icon-only bigger-110"></i>
</a>
<script type="text/javascript">
	if("ontouchend" in document) document.write("<script src='__PUBLIC__/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
</script>
<load href="__PUBLIC__/js/bootstrap.min.js" />
<load href="__PUBLIC__/js/typeahead-bs2.min.js" />
<load href="__PUBLIC__/js/ace-elements.min.js" />
<load href="__PUBLIC__/js/ace.min.js" />
<load href="__PUBLIC__/js/jquery-ui-1.10.3.full.min.js" />
<load href="__PUBLIC__/js/jquery.ui.touch-punch.min.js" />
<script type="text/javascript">
$(function(){
    $('input[type=checkbox][data]').each(function(){
        var da = $(this).attr('data');
        var va = $(this).val();
        if (va == da) 
            $('input[type=checkbox][data='+va+']').attr("checked", "checked");
    })
    //selected 自动填充
    $('select[data]').each(function(){
        var val = $(this).attr('data');
        $(this).val(val);
    })

    $('span.upfile,input.upfile').on('click',function(){
        var to = $(this).attr('to');
        var dialog = $( "#img-dialog" ).removeClass('hide').dialog({
            modal: true,
            title: "<div class='widget-header widget-header-small'><h4 class='smaller'><i class='icon-ok'></i>文件选择</h4></div>",
            title_html: true,
            resizable : false,
            draggable : false,
            width:860,
            height:600,
            open: function( event, ui ) {
                $('.img_content').load("{:U('Member/Index/filebox')}&to="+to);
            }
        });
    });



})


$.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
    _title: function(title) {
        var $title = this.options.title || '&nbsp;'
        if( ("title_html" in this.options) && this.options.title_html == true )
            title.html($title);
        else title.text($title);
    }
}));
$( "[delete]" ).on('click', function(e) {
    var url = $(this).attr('href');
    e.preventDefault();
    $( "#delete-dialog-confirm" ).removeClass('hide').dialog({
        resizable: false,
        modal: true,
        title: "<div class='widget-header'><h4 class='smaller'><i class='icon-warning-sign red'></i>数据删除确认?</h4></div>",
        title_html: true,
        buttons: [
            {
                html: "<i class='icon-trash bigger-110'></i>&nbsp; 确定",
                "class" : "btn btn-danger btn-xs",
                click: function() {
                    window.location.href=url; 
                    $( this ).dialog( "close" );
                    // return true;
                }
            }
            ,
            {
                html: "<i class='icon-remove bigger-110'></i>&nbsp; 取消",
                "class" : "btn btn-xs",
                click: function() {
                    $( this ).dialog( "close" );
                    return false;
                }
            }
        ]
    });
});    
</script>

